/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.employee.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.employee.entity.StoreBonusSettingProduct;

/**
 * 产品销售提成设定DAO接口
 * @author liujiang
 * @version 2013-11-19
 */
public interface StoreBonusSettingProductDao extends StoreBonusSettingProductDaoCustom, CrudRepository<StoreBonusSettingProduct, Long> {
	@Query("from StoreBonusSettingProduct cs where cs.store.id=?1 and cs.employee.id=?2 and cs.product_type=?3 and  cs.product_category_id=?4 and  cs.card_type=?5")
	public List<StoreBonusSettingProduct> list(long storeID,long employeeId, int productType,long product_category_id,int card_type);
	
	@Query("select cs.product_category_id from StoreBonusSettingProduct cs where cs.store.id=?1 and cs.employee.id=?2 and cs.product_type=?3 and cs.card_type=?4")
	public List<Long> getExistTemplateId(Long storeId, long employeeId, int productType, int cardType);
}

/**
 * DAO自定义接口
 * @author liujiang
 */
interface StoreBonusSettingProductDaoCustom extends BaseDao<StoreBonusSettingProduct> {

}

/**
 * DAO自定义接口实现
 * @author liujiang
 */
@Component
class StoreBonusSettingProductDaoImpl extends BaseDaoImpl<StoreBonusSettingProduct> implements StoreBonusSettingProductDaoCustom {

}
